var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ObjectId = Schema.ObjectId;

var ArticleSchema = new Schema({
    title: String,  // 文章标题
    author: String,  // 文章作者
    user_id: ObjectId,  // 用户ID
    cover: String,      // 封面
    createDate: { type: Date, default: Date.now },   // 创建日期
    content: String,  // 文章内容
    release: Boolean,  // 是否发布
});

mongoose.model('Article', ArticleSchema);